<!--头部模板-->
<script>
    if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
        document.write("<script src=' {{ staticThemePath }}/js/iscroll/iscroll.js'><" + '/' + "script>");
        $(function () {
            new IScroll('#navWrapper', {
                scrollX: true,
                scrollY: false,
                mouseWheel: true,
                click: true
            });
        })
    }
</script>
<input type="hidden" value="{{ userInfo._id }}" id="userId">
    <input type="hidden" value="{{ logined }}" id="logined">
        <input type="hidden" value="{{ tokenId }}" id="tokenId">
            <header class="clearfix" id="header" ms-controller="headerCtr">
                {% if site.lang == 'zh-TW' %}
                    {% set homelink = '/zh-TW' %}
                    {% set endStr = '_zh-TW' %}
                {% else %}
                    {% set homelink = '/zh-CN' %}
                    {% set endStr = '' %}
                {% endif %}
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-md-12 header-box">
                            <div class="row header-main">
                                <div class="col-sm-2 col-md-2">
                                    <div class="site-name ">
                                        <a href="{{ homelink }}" id="logo">
                                            <img src="{{ site.logo }}" alt="{{ site.title }}"/>
                                        </a>
                                    </a>
                                </div>
                            </div>
                            <div class="col-sm-9 col-md-6" id="navWrapper">
                                <div id="navScroller">
                                    <ul>
                                        {% for cate in navigation %}
                                            {% if cate.parentId == '0' %}
                                                <li role="presentation">
                                                    <a role="menuitem" tabindex="-1" alt="{{ site.altkey }}{{ cate.name }}" href="{{ cate.url }}">{{ cate.name }}</a>
                                                </li>
                                            {% endif %}
                                        {% endfor %}
                                    </ul>
                                </div>
                            </div>
                            <div class="col-sm-1 col-md-4">
                                <div class="text-right topNav">
                                    <div class="search-pannel">
                                        <div :class="['input-area',(@activeSearch? 'active':'')]">
                                            <div class="el-input el-input--small">
                                                <input ms-on-keyup="@onKeyUp" type="text" class="form-control" ms-duplex="@searchkey" placeholder="{{ __('lc_please_write_key') }}"></div>
                                                <i ms-click='@searchMe' class="fa fa-search"></i>
                                            </div>
                                        </div>
                                        <ul class="navbar-right">
                                            {% if logined == undefined %}
                                                <li>
                                                    <a rel="nofollow" href="/users/login">{{ __('lc_login') }}</a>
                                                </li>
                                                <li>
                                                    <a rel="nofollow" href="/users/reg">{{ __('lc_newAccount') }}</a>
                                                </li>
                                            {% else %}
                                                <li class="dropdown">
                                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ userInfo.userName }}
                                                        <span class="caret"></span>
                                                    </a>
                                                    <ul class="dropdown-menu">
                                                        <li>
                                                            <a href="/users/userContents">{{ __('lc_userCenter') }}</a>
                                                        </li>
                                                        <li>
                                                            <a href="/users/userCenter">{{ __('lc_accountSet') }}</a>
                                                        </li>
                                                        <li>
                                                            <a href="#" id="userLoginOut">{{ __('lc_loginOut') }}</a>
                                                        </li>
                                                    </ul>
                                                </li>
                                            {% endif %}
                                            <li>
                                                <button type="button" ms-on-click="@postArticel" class="btn btn-primary btn-sm navbar-btn">{{ __('lc_myPostArticels') }}</button>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </header>